import React from 'react'
import check from '@/assets/images/user/choice_me.png'

interface IProp {
    data: OptionModel;
    isChecked: boolean;
    onChange: (key: string) => void;
}

export default function OptionItem({ data, isChecked, onChange }: IProp) {
    return (
        <div className='opt-item' onClick={() => onChange(data.key)}>
            <div className="check">
                <img style={{ display: isChecked ? 'block' : 'none' }} src={check} alt="" />
            </div>
            <div className="key">{data.key}</div>
            <div className="content">
                {data.value}
            </div>
        </div>
    )
}
